﻿using System;
using System.Collections.Generic;
using System.Text;
using Wfxin.RabbitMQ;

namespace Wfxin.SystemFramework.SystemLog
{
    public static class SystemLoggingOptionsExtensions
    {
        public static SystemLoggingOptions UseRabbitMQ(this SystemLoggingOptions options, string hostName)
        {
            return options.UseRabbitMQ(opt => { opt.HostName = hostName; });
        }

        public static SystemLoggingOptions UseRabbitMQ(this SystemLoggingOptions options, Action<RabbitMQOptions> configure)
        {
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            //configure += x => x.ExchangeName = "eps.syslogging.router";
            //configure += new Action<RabbitMQOptions>(opt =>
            //{
            //    opt.ExchangeName = Constants.EXCHANGE_NAME;
            //    opt.ExchangeType = Constants.EXCHANGE_TYPE;
            //});

            //options.Register(new SystemLoggingOptionsExtensions(configure));

            return options;
        }
    }
}
